# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Jacques Fontaine <waitnsea@free.fr>
# Contributor: Ryan Young <ryan31415926535@gmail.com>

pkgname=linssid
pkgver=3.6
pkgrel=10
pkgdesc='Graphical wireless scanner for Linux'
url='https://sourceforge.net/projects/linssid/'
arch=('loong64' 'x86_64')
license=('GPL3')
depends=('qt5-base' 'qt5-svg' 'qwt' 'libxkbcommon-x11' 'iw' 'wireless_tools' 'xdg-utils'
         'desktop-file-utils' 'gtk-update-icon-cache')
makedepends=('boost')
optdepends=('sudo: privilege escalation to use wireless tools')
source=(${pkgname}-${pkgver}.tar.gz::https://downloads.sourceforge.net/${pkgname}/${pkgname}_${pkgver}.orig.tar.gz
        linssid-qwt-6.2.patch)
sha256sums=('57301ee93f708f2512316668bf4e718502f37f21a5e93b68fc604a9032e3e49c'
            '3b6df6cede4313a72adc473a3c1223bef0cbedc7dcc67d55e7ed33cb896bf999')
sha512sums=('066c890776a23d0e5fe8518826c64edc4b7d6dcef28cd7ce58f842e52b9e2b13517358ca6df636613abd1e860b20c6b542b5df165de1aa262e1e7db8a60e00e5'
            '4c450580374cb307856b8a81fc5ab42c5367cc6c6f8942d0b0b4a00ffb49b58164d4a13d2effeb865917938b89d62a15b624ec1a829501d30b763aebf2183870')

prepare() {
  cd ${pkgname}-${pkgver}
  sed -r 's|libqwt-qt5.so|libqwt.so|g' -i linssid-app/linssid-app.pro
  sed -r 's|/usr/sbin|/usr/bin|g' -i linssid-app/linssid-app.pro

  patch -p1 -i ../linssid-qwt-6.2.patch # Fix build with qwt 6.2
}

build() {
  cd ${pkgname}-${pkgver}
  qmake-qt5
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make INSTALL_ROOT="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
